<template>
  <div class="point-status-list">
    <el-table
      stripe
      height="298"
      :data="showList"
      style="width: 100%;"
      :header-cell-style="rowClass"
      :cell-style="cellStyle"
    >
      <el-table-column
        align="center"
        label="点位名称"

        prop="point_name"
        style="background:red"
      ></el-table-column>
      <el-table-column
        align="center"
        label="状态时间"

        prop="change_date"
      ></el-table-column>
      <el-table-column
        align="center"
        label="状态类型"
        prop="record_value"
      >
        <template slot-scope="{row}">
          <span :class="'greenFont'+row.record_value">{{row.record_value|statusTrans}}</span>
        </template>
      </el-table-column>
    </el-table>
    <center>
    <el-pagination

      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      background
      layout="prev, pager, next"
      :page-size="pageSize"
      :total="allDataList.length">
    </el-pagination>
    </center>
  </div>
</template>

<script>
  export default {
    name: "index",
    filters: {
      statusTrans(v) {
        let statusStr = '';
        switch (v) {
          case 1 :
            statusStr = '启动';
            break;
          case 0 :
            statusStr = '停止';
            break;
          case 3 :
            statusStr = '数据中断';
            break;

        }
        return statusStr;
      },
      statusColor(v) {
        return 'redFont';
      }
    },
    data() {
      return {
        showList: [],
        allDataList: [],
        pageSize: 10

      }
    },
    methods: {
      setData(dataList) {
        this.allDataList = dataList;
        this.showList = this.allDataList.slice(0, this.pageSize)
      },
      handleCurrentChange(pageIndex, a, b) {
        let start = (pageIndex - 1) * this.pageSize;
        this.showList = this.allDataList.slice(start, start + this.pageSize)
      },
      handleSizeChange(val, a, b) {
      },
      rowClass() {
        return 'background: #383b3e;color: #fff;font-weight: 600;border: 1px solid #383b3e'
      },
      cellStyle() {
        return 'background: #383b3e;color: #fff;font-weight: 600;border: 1px solid #383b3e'
      }
    }
  }
</script>

<style lang="scss" scoped>
  .point-status-list {
    background-color: #383b3e;
    height: 330px;
    padding: 0px;
    .greenFont3 {
      color: #8994b8;
      font-weight: bold;
    }
    .greenFont0 {
      color: #e63743;
      font-weight: bold;
    }
    .greenFont1 {
      color: #48eb42;
      font-weight: bold;
    }

 /*   .el-table, .el-table__expanded-cell {
      background-color: #383b3e;
    }*/
    .el-table{
      background-color: #383b3e;
    }
    /*chrome滚动条颜色设置*/

    *::-webkit-scrollbar {width:7px; height:10px; background-color:transparent;} /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
    *::-webkit-scrollbar-track {background-color:#f0f6ff;  } /*定义滚动条轨道 内阴影+圆角*/
    *::-webkit-scrollbar-thumb {background-color:#73abb1; border-radius:6px;} /*定义滑块 内阴影+圆角*/
    .scrollbarHide::-webkit-scrollbar{display: none}
    .scrollbarShow::-webkit-scrollbar{display: block}
  }



</style>
